package com.sysu.homework.model;

import javax.enterprise.inject.Default;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;

@Entity
public class HomeworkResult {
	private int id;
	private String filename;
	private String title;
	private Student student;
	private Homework homework;
	private Double grade;
	private int rank;
	
	@Id
	@GeneratedValue
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getFilename() {
		return filename;
	}
	public void setFilename(String filename) {
		this.filename = filename;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	@ManyToOne
	public Student getStudent() {
		return student;
	}
	public void setStudent(Student student) {
		this.student = student;
	}
	
	public void setHomework(Homework homework) {
		this.homework = homework;
	}
	@OneToOne
	public Homework getHomework() {
		return homework;
	}
	public void setGrade(Double grade) {
		this.grade = grade;
	}
	public Double getGrade() {
		return grade;
	}
	public void setRank(int rank) {
		this.rank = rank;
	}
	public int getRank() {
		return rank;
	}
	
}
